<h3><?php echo $title; ?></h3>



<?php echo form_open('admin/permission/request'); ?>

<div class="control1">

<?php

	//add button

  echo link_image('admin/permission/create', 'images/admin/button_add.png');

  

  //delete button

  $data = array('name' => 'delete', 'value' => '', 'id' => 'delete');

  echo form_submit($data);

 

  //show field

  $data = array('name' => 'show', 'value' => '', 'id' => 'show');	

  echo form_submit($data);
//$_SESSION['row_number']
  $data = array('name' => 'row_number', 'value' => $_SESSION['row_number'], 'id' => 'show_number');	

  echo form_input($data);

?>

</div><!--control1 end-->
<table class="default">
<?php

	if (is_array($result) )

	{

		//title

		echo '<tr>';

		echo '<th width="50" >';
			echo '&nbsp;',form_checkbox('all'),'&nbsp;All';
		echo '</th>';


   // echo '<th width="70">Active</th>';

    echo '<th width="70">'.$this->lang->line('code').'</th>';

		echo '<th width="200">'.$this->lang->line('title_user_name').'</th>';
		 echo '<th width="200">'.$this->lang->line('title_user_lvl').'</th>';

	//	echo '<th width="100">Info</th>';

		echo '</tr>';

		

		//print

		foreach ($result as $row)

		{

			echo '<tr>';



			//action

			echo '<td>';

			echo form_checkbox('select_id[]', $row['per_id']);

			echo '&nbsp;';

			echo anchor('admin/permission/update/'.$row['per_id'], 'Edit');

			echo '</td>';






      //Code

			echo '<td>';

      echo $row['per_id'];

			echo '</td>';



			//name

			echo '<td class="align_left"  style="text-align:center">';

   

			echo $row['per_name'];

			echo '</td>';			


      //Module
	  	if($row['per_module'] == "fullcontrol" ||$row['per_module'] == "" )
		{	$module= $row['per_module'];
			
		}else
	  		$module=  unserialize($row['per_module']);
		
		if(is_array($module))
		{
			$m = "";
			foreach($module as $item)
			{
				
				$m .=$item.","; 
			}
			$m =substr($m,0,strlen($m) -1);
			
		}
		else
			$m = $module;
			

			echo '<td>';
		echo $m;
		
		echo '</td>';
			//Info

	/*		echo '<td>';

			echo mailto($row['user_email'], 'Email');

      echo '&nbsp;'.anchor('#', 'Phone', 'title="'.$row['phone'].'"');

			echo '</td>';
*/
			

			echo '</tr>';

		}

	}

	else

	{

		echo 'Data does not exist';

	}

?>

</table><!--end main content-->



<?php

	echo form_close(); //FORM END

	

	//page
	
	echo '<div class="page">'.$page.'</div>';

?>